<template>
  <div style="padding-top: 20px; padding-left: 30px;padding-right: 30px;background-color: #fff">
    <div>
      <el-form ref="justinTime" :inline="true" :model="justinTime" class="demo-form-inline" label-width="90px" size="small">
        <el-form-item label="单据编号" >
          <el-input v-model="justinTime.id" placeholder="单据编号" />
        </el-form-item>
        <el-form-item label="单据日期">
          <el-date-picker
            v-model="justinTime.startDate"
            align="right"
            type="date"
            style="width: 150px"
            placeholder="请选择开始">
          </el-date-picker>
          <span style="color: #99a9bf"> ~ </span>
          <el-date-picker
            v-model="justinTime.tailDate"
            align="right"
            type="date"
            style="width: 150px"
            placeholder="请选择结束">
          </el-date-picker>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-search" >查询</el-button>
          <el-button icon="el-icon-refresh" @click="resetForm()">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <!-- -->
    <div>
      <el-button type="text" icon="el-icon-plus" style="margin-left: 20px" @click="dialogFormVisible=true;dialogTitle='库存调拨 - 新增'">新增</el-button>
      <el-button type="text" icon="el-icon-upload" style="margin-left: 30px">导入</el-button>
      <el-button type="text" icon="el-icon-download" style="margin-left: 30px">导出</el-button>
      <el-button type="text" icon="el-icon-circle-close" style="margin-left: 30px" >取消选择</el-button>
    </div>
    <!-- -->
    <div>
      <el-table
        v-loading="loading"
        :data="allocation"
        :header-cell-style="{background:'#F5F7FA',color:'#606266'}"
        border
        size="mini"
        style="width: 100%">
        <el-table-column type="selection" width="55"></el-table-column>
        <el-table-column type="index" fixed width="50"></el-table-column>
        <el-table-column label="单据编号" fixed width="160">
          <template slot-scope="scope">
            <el-button type="text" size="mini" >{{ scope.row.commId }}</el-button>
          </template>
        </el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="单据日期" ></el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="制单人" ></el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="处理状态" ></el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="是否通过" ></el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="是否关闭" ></el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="是否作废 " ></el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="生效时间" ></el-table-column>
        <el-table-column prop="commodityBill.commName" align="center" label="审核人" ></el-table-column>
        <el-table-column prop="depotBill.depotName" align="center" label="流程" ></el-table-column>
        <el-table-column prop="gmtModified" align="center" sortable label="修改时间" show-overflow-tooltip ></el-table-column>
        <el-table-column prop="gmtCreate" align="center" label="创建时间" show-overflow-tooltip ></el-table-column>
        <el-table-column
          fixed="right"
          label="操作"
          align="center"
          width="150">
          <template slot-scope="scope">
            <el-button type="text" size="small" >编辑</el-button>
            <el-dropdown>
              <span style="cursor: pointer;color: #409EFF; font-size: 12px">
                更多<i class="el-icon-arrow-down el-icon--right"></i>
              </span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item icon="el-icon-plus">关闭</el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
      </el-table>
    </div>
    <!-- 分页 -->
    <div class="block" style="margin-top: 20px;">
      <el-pagination
        :current-page="pagination.currentPage"
        :page-sizes="[5, 10]"
        :page-size="pagination.pageSize"
        :total="pagination.total"
        layout="total, sizes, prev, pager, next, jumper"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange">
      </el-pagination>
    </div>
    <div>
      <el-dialog :visible.sync="dialogFormVisible" :title="dialogTitle" style="margin-top: -70px" width="85%" >
        <allcation-add></allcation-add>
      </el-dialog>
    </div>
  </div>
</template>

<script>
import allcationAdd from './add'
export default {
  name: 'allocation',
  components: {
    allcationAdd
  },
  data() {
    return {
      justinTime: {
        id: '',
        startDate: null,
        tailDate: null
      },
      allocation: [],
      pagination: {
        pageSize: 5,
        currentPage: 2,
        total: 20
      },
      loading: false,
      dialogFormVisible: false,
      dialogTitle: ''
    }
  },
  methods: {
    resetForm() {},
    handleSizeChange() {},
    handleCurrentChange() {}
  }
}
</script>

<style >
.el-dialog__header{
  border-bottom: 1px solid #e8eaec;
}
</style>
